# Contributor: Adrian L Lange <alpine@p3lim.net>
# Contributor: Charles Wimmer <charles@wimmer.net>
# Contributor: Dermot Bradley <dermot_bradley@yahoo.com>
# Maintainer: Dermot Bradley <dermot_bradley@yahoo.com>
pkgname=step-cli
pkgver=0.21.0
pkgrel=0
pkgdesc="Zero trust swiss army knife that integrates with step-ca for automated certificate management"
url="https://github.com/smallstep/cli"
arch="all !riscv64" # ftbfs
license="Apache-2.0"
makedepends="
	bash
	go
	go-bindata
	"
subpackages="
	$pkgname-bash-completion
	$pkgname-zsh-completion
	"
source="
	$pkgname-$pkgver.tar.gz::https://github.com/smallstep/cli/archive/refs/tags/v$pkgver.tar.gz
	"
builddir="$srcdir/cli-$pkgver"

build() {
	make build
}

check() {
	make test
}

package() {
	make DESTDIR="$pkgdir" install

	install -Dm644 autocomplete/bash_autocomplete \
		"$pkgdir"/usr/share/bash-completion/completions/step

	install -Dm644 autocomplete/zsh_autocomplete \
		"$pkgdir"/usr/share/zsh/site-functions/_step
}

sha512sums="
39aabc98f9b0bcec3837c19bb653172bc6baf1c059f478dd1086fe1045d1bb1e3393dc3f90e998dbe19826b6eaf71ee8b351a0cf7b816763a18c7c5f2318d671  step-cli-0.21.0.tar.gz
"
